﻿@{
    ViewData["Title"] = "Liyy的博客";
}
@model List<LyyCMS.Core.Models.Blog>


<div class="jumbotron">
    <h1>Hello, world!</h1>
    <p>Liyy</p>
    <p><a class="btn btn-primary btn-lg" href="javascript:void(0);" role="button">了解我</a></p>
</div>
<div class="row">
    <div class="col-md-8">
        @foreach (var blog in Model)
        {
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">@blog.Title <span>@blog.Create_At</span></h3>
                </div>
                <div class="card-body">
                    @blog.Content
                </div>
                <div class="card-footer"><a asp-action="Details" asp-route-id="@blog.Id">查看详情</a></div>
            </div>
            <div class="" style="width:100%; height:10px;clear:both;"></div>
        }

    <nav aria-label="Page navigation example" style="border:1px solid #0366d6;">
        
        <a class="nav-link" asp-action="Index" asp-route-page="@ViewBag.preview" style="display:inline-block">上一页</a>        

        @for (int m = 1; m <= ViewBag.pagecount; m++)
        {
            <a class="nav-link" asp-action="Index" asp-route-page="@m" style="display:inline-block">第 @m 页</a>
        }
       
        <a class="nav-link" asp-action="Index" asp-route-page="@ViewBag.nextpage" style="display:inline-block">下一页</a>
       

        @*<ul class="pagination" data-current="@ViewBag.currentpage">
            <li class="page-item">
                <a class="page-link" aria-label="Previous" asp-route="Index" asp-route-page="@ViewBag.currentpage-1">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            @for (int i = 1; i < ViewBag.pagecount; i++)
            {
                <li class="page-item">
                    <a class="page-link" asp-route="Index" asp-route-page="@i">@i</a>
                </li>
            }
            <li class="page-item">
                <a class="page-link" aria-label="Next" asp-route="Index" asp-route-page="@ViewBag.currentpage+1">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>*@
    </nav>      
    </div>
    <div class="col-md-4">
        <div class="card">
            <div class="card-header">
                <div class="card-title">分类</div>
            </div>
            
            <div class="card-body">
                <ul class="nav flex-column">
                    @foreach (var cate in Html.GetEnumSelectList(typeof(LyyCMS.Core.Models.BlogCategory)))
                    {
                        <li class="nav-item">
                            <a class="nav-link" asp-action="CateList" asp-route-id="@cate.Value" asp-route-page="1">@cate.Text</a>
                        </li>
                    }

                </ul>
            </div>
        </div>
        
    </div>
</div>